package com.luke.springcloud.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RefreshScope//表明配置项可以动态刷新
@RestController
public class ConfigClientController {

    @Value("${foo}")
    private String foo;

    @GetMapping("/getFooFromConfigServer")
    public String getFooFromConfigServer(){
        return foo;
    }

}
